<%
class ContactAction 'extends CommonAction
	Sub newContact
		on error resume next
		dim data,row,m,key,rs
		set data = json_decode( POP_MVC.post("_data") ) 
		set m = M_("contact")
		for each key in data
			set row = data(key)
			if is_empty( row("id") ) Then
				row("add_time") = now()
				row.remove("id")
				if m.db.data(row).create(1) then				
					call m.db.add()
				else
					call that.ajaxReturn( array(m.db.error,"修改失败",0) ) 
					exit sub
				end if
			else
				call m.db.where( "id = " & row("id") ).setField(row,"")
			end if
		next
		set rs = m.db.select()
		call that.ajaxReturn( rs )		'ajaxReturn自动注销rs
	end Sub
End Class
%>